package xhq.com.test.extspring.bean.model;

import org.springframework.util.StringUtils;

/**
 * @author hq_xu
 * @since 2021/1/26 8:41
 */
public class MyBeanClass {
    private String familyName;
    private String givenName;

    public String getName() {
        if(StringUtils.hasLength(familyName) && StringUtils.hasLength(givenName)) {
            return givenName + " " + familyName;
        }

        var tmpGivenName = StringUtils.hasLength(givenName) ? givenName : "";
        return StringUtils.hasLength(familyName) ? familyName : tmpGivenName;
    }

    // region get and set
    public String getFamilyName() {
        return familyName;
    }

    public void setFamilyName(String familyName) {
        this.familyName = familyName;
    }

    public String getGivenName() {
        return givenName;
    }

    public void setGivenName(String givenName) {
        this.givenName = givenName;
    }
    // endregion
}
